package com.yhl.springtest.controller;

import com.yhl.springtest.service.CommomService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.io.IOException;
import java.net.InetAddress;
import java.util.Map;

/**
 * @author: yanghl
 * @description: TODO
 * @date: 2023/8/15 14:45
 */
@RequestMapping("/AOP")
@RestController
public class AOPController {
    @Autowired
    CommomService commomService;

    @GetMapping("/getInfo")
    public String getInfo(){
        String ret = "";
        InetAddress myIp = commomService.getMyIp();
        if (myIp != null){
            ret = myIp.getHostName() + ":" + myIp.getHostAddress();
        }
        return ret;
    }

    @GetMapping("/getMemory")
    public String getMemory(){
        return commomService.getMemory();
    }

    @GetMapping("/getSome")
    public String getSome(){
        return commomService.getSome();
    }




}

